home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / needac2a / aboutbox.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-09-27  |  9.1 KB  |  263 lines

  1. VERSION 2.00
  2. Begin Form AboutBox 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "About"
  6.    ClientHeight    =   1905
  7.    ClientLeft      =   1545
  8.    ClientTop       =   2115
  9.    ClientWidth     =   4920
  10.    ClipControls    =   0   'False
  11.    ControlBox      =   0   'False
  12.    FillColor       =   &H00FFFFFF&
  13.    FontBold        =   -1  'True
  14.    FontItalic      =   0   'False
  15.    FontName        =   "System"
  16.    FontSize        =   9.75
  17.    FontStrikethru  =   0   'False
  18.    FontUnderline   =   0   'False
  19.    Height          =   2310
  20.    Icon            =   0
  21.    Left            =   1485
  22.    LinkMode        =   1  'Source
  23.    LinkTopic       =   "Form1"
  24.    MaxButton       =   0   'False
  25.    MinButton       =   0   'False
  26.    ScaleHeight     =   1905
  27.    ScaleWidth      =   4920
  28.    Top             =   1770
  29.    Width           =   5040
  30.    Begin CommandButton BTN_OK 
  31.       Caption         =   "&OK"
  32.       Height          =   465
  33.       Left            =   1920
  34.       TabIndex        =   8
  35.       Top             =   1080
  36.       Width           =   1200
  37.    End
  38.    Begin Label RegToLabel 
  39.       Alignment       =   2  'Center
  40.       BackStyle       =   0  'Transparent
  41.       Height          =   240
  42.       Left            =   0
  43.       TabIndex        =   13
  44.       Top             =   3000
  45.       Width           =   4875
  46.    End
  47.    Begin Label UserNameLabel 
  48.       Alignment       =   2  'Center
  49.       BackStyle       =   0  'Transparent
  50.       Height          =   240
  51.       Left            =   0
  52.       TabIndex        =   12
  53.       Top             =   3175
  54.       Width           =   4875
  55.    End
  56.    Begin Label DisclaimerLabel 
  57.       Alignment       =   2  'Center
  58.       BackStyle       =   0  'Transparent
  59.       Caption         =   "www.errorrdomain.com"
  60.       Height          =   1725
  61.       Left            =   15
  62.       TabIndex        =   11
  63.       Top             =   720
  64.       Width           =   4875
  65.    End
  66.    Begin Label Lbl_InfoValue 
  67.       BackStyle       =   0  'Transparent
  68.       Height          =   1050
  69.       Left            =   2900
  70.       TabIndex        =   10
  71.       Top             =   2100
  72.       Width           =   1900
  73.    End
  74.    Begin Label Lbl_Info 
  75.       Alignment       =   1  'Right Justify
  76.       BackStyle       =   0  'Transparent
  77.       Height          =   1050
  78.       Left            =   100
  79.       TabIndex        =   9
  80.       Top             =   2100
  81.       Width           =   2600
  82.    End
  83.    Begin Label Label7 
  84.       Alignment       =   2  'Center
  85.       BackColor       =   &H00FFFFFF&
  86.       BackStyle       =   0  'Transparent
  87.       Height          =   240
  88.       Left            =   0
  89.       TabIndex        =   7
  90.       Top             =   1750
  91.       Width           =   4875
  92.    End
  93.    Begin Label Label4 
  94.       Alignment       =   2  'Center
  95.       BackColor       =   &H00FFFFFF&
  96.       BackStyle       =   0  'Transparent
  97.       ForeColor       =   &H00000000&
  98.       Height          =   240
  99.       Left            =   0
  100.       TabIndex        =   4
  101.       Top             =   1290
  102.       Width           =   4875
  103.    End
  104.    Begin Label Label3 
  105.       Alignment       =   2  'Center
  106.       BackColor       =   &H00FFFFFF&
  107.       BackStyle       =   0  'Transparent
  108.       ForeColor       =   &H00000000&
  109.       Height          =   240
  110.       Left            =   0
  111.       TabIndex        =   3
  112.       Top             =   1100
  113.       Width           =   4875
  114.    End
  115.    Begin Label Label2 
  116.       Alignment       =   2  'Center
  117.       BackColor       =   &H00FFFFFF&
  118.       BackStyle       =   0  'Transparent
  119.       ForeColor       =   &H00000000&
  120.       Height          =   240
  121.       Left            =   0
  122.       TabIndex        =   2
  123.       Top             =   900
  124.       Width           =   4875
  125.    End
  126.    Begin Label Label1 
  127.       Alignment       =   2  'Center
  128.       BackColor       =   &H00FFFFFF&
  129.       BackStyle       =   0  'Transparent
  130.       ForeColor       =   &H00000000&
  131.       Height          =   240
  132.       Left            =   0
  133.       TabIndex        =   1
  134.       Top             =   1550
  135.       Width           =   4875
  136.    End
  137.    Begin Label LAB_2 
  138.       Alignment       =   2  'Center
  139.       BackColor       =   &H00FFFFFF&
  140.       BackStyle       =   0  'Transparent
  141.       Caption         =   "Code by Justo Torres"
  142.       ForeColor       =   &H00000000&
  143.       Height          =   240
  144.       Left            =   0
  145.       TabIndex        =   0
  146.       Top             =   480
  147.       Width           =   4875
  148.    End
  149.    Begin Label Label5 
  150.       Alignment       =   2  'Center
  151.       BackColor       =   &H00FFFFFF&
  152.       BackStyle       =   0  'Transparent
  153.       ForeColor       =   &H00000000&
  154.       Height          =   240
  155.       Left            =   0
  156.       TabIndex        =   5
  157.       Top             =   360
  158.       Width           =   4875
  159.    End
  160.    Begin Label LAB_1 
  161.       Alignment       =   2  'Center
  162.       AutoSize        =   -1  'True
  163.       BackColor       =   &H00FFFFFF&
  164.       BackStyle       =   0  'Transparent
  165.       Caption         =   "ErrorR MIDI PLAYER"
  166.       FontBold        =   -1  'True
  167.       FontItalic      =   0   'False
  168.       FontName        =   "MS Sans Serif"
  169.       FontSize        =   13.5
  170.       FontStrikethru  =   0   'False
  171.       FontUnderline   =   0   'False
  172.       ForeColor       =   &H00000000&
  173.       Height          =   360
  174.       Left            =   975
  175.       TabIndex        =   6
  176.       Top             =   0
  177.       Width           =   2925
  178.    End
  179. DefInt A-Z
  180. ' API functions used in getting user and company name
  181. Declare Function LoadLibrary% Lib "Kernel" (ByVal LibFileName$)
  182. Declare Sub FreeLibrary Lib "Kernel" (ByVal hInst%)
  183. Declare Function LoadString% Lib "User" (ByVal hInst%, ByVal idResource%, ByVal Buffer$, ByVal cBuffer%)
  184. ' GetVersion returns both Windows and DOS versions
  185. Declare Function GetVersion& Lib "Kernel" ()
  186. ' This function returns a Long that's filled with bit-flags providing
  187. ' information about Windows.
  188. Declare Function GetWinFlags& Lib "Kernel" ()
  189.  Const WF_PMODE = &H1
  190.  Const WF_STANDARD = &H10
  191.  Const WF_ENHANCED = &H20
  192.  Const WF_80x87 = &H400
  193. ' This function returns the amount of free memory
  194. Declare Function GetFreeSpace& Lib "Kernel" (ByVal wFlags%)
  195. 'This function returns the free system resources
  196. Declare Function GetFreeSystemResources% Lib "User" (ByVal fuSysResource%)
  197.  Const GFSR_SYSTEMRESOURCES = 0
  198.  Const GFSR_GDIRESOURCES = 1
  199.  Const GFSR_USERRESOURCES = 2
  200. Sub BTN_OK_Click ()
  201.     Unload AboutBox
  202. End Sub
  203. Function FixAmpersand$ (ByVal Buffer As String)
  204.   Dim N%
  205.   N = 1
  206.   Do Until N = 0
  207.     N = InStr(N, Buffer, "&")
  208.     If N > 0 Then
  209.       Buffer = Left$(Buffer, N) + Mid$(Buffer, N)
  210.       N = N + 2
  211.     End If
  212.   Loop
  213.   Do While Right$(Buffer, 1) = Chr$(0) 'Or Right$(Buffer, 1) = " "
  214.     Buffer = Left$(Buffer, Len(Buffer) - 1)
  215.   Loop
  216.   FixAmpersand = Buffer
  217. End Function
  218. Sub Form_Load ()
  219.     Dim WinFlags As Long
  220.     Dim Mode As String, CoProcessor As String
  221.     Move (Screen.Width - Width) \ 2, ((Screen.Height - Height) \ 2 - 200)
  222.     ' Get current Windows configuration
  223.     WinFlags = GetWinFlags()
  224.     If WinFlags And WF_ENHANCED Then
  225.         Mode = "386 Enhanced Mode"
  226.     Else
  227.         Mode = "Standard Mode"
  228.     End If
  229.     Lbl_Info.Caption = Mode + CRLF + "Free Memory:" + CRLF + "Math Co-processor:" + CRLF + "System Resources:"
  230.     If WinFlags And WF_80x87 Then
  231.         CoProcessor = "Present"
  232.     Else
  233.         CoProcessor = "None"
  234.     End If
  235.     I% = GetFreeSystemResources(2)
  236.     Lbl_InfoValue.Caption = CRLF + Format$(GetFreeSpace(0) \ 1024) + " KB" + CRLF + CoProcessor + CRLF + Str(I%) + "%"
  237.     'Resolution.Caption = "Resolution: " & Screen.Width \ Screen.TwipsPerPixelX & " x " & Screen.Height \ Screen.TwipsPerPixelY
  238.     DisclaimerText$ = " This software and the accompanying files are provided ""as is"" "
  239.     DisclaimerText$ = DisclaimerText$ + "and without warranties as to performance of the software and "
  240.     DisclaimerText$ = DisclaimerText$ + " the accompanying files or any other warranties whether expressed "
  241.     DisclaimerText$ = DisclaimerText$ + " or implied.  No warranty of fitness for a particular purpose "
  242.     DisclaimerText$ = DisclaimerText$ + "is offered." + CRLF + CRLF
  243.     DisclaimerText$ = DisclaimerText$ + "You may not sell this software or it's source code." + CRLF
  244.     DisclaimerText$ = DisclaimerText$ + "You may use this code in any way you find useful."
  245.     DisclaimerLabel.Caption = DisclaimerText$
  246.     ' Get access to USER's strings by getting a handle to USER
  247.     Dim hInstUser As Integer
  248.     hInstUser = LoadLibrary("USER")
  249.     FreeLibrary hInstUser
  250.     Dim Buffer As String, Success As Integer, N As Integer
  251.   ' Get the User name
  252.     Buffer = String$(31, 0)
  253.     If LoadString(hInstUser, 514, Buffer, 30) Then
  254.       UserNameLabel.Caption = Trim(FixAmpersand(Buffer))
  255.     End If
  256.   ' Get the Company name
  257.   '  Buffer = String$(31, 0)
  258.   '  If LoadString(hInstUser, 515, Buffer, 30) Then
  259.   '    'CompanyName$ = FixAmpersand(Buffer)
  260.   '    CompanyLabel.Caption = Trim(FixAmpersand(Buffer))
  261.   '  End If
  262. End Sub
  263.